//
//  KDVpnModel.m
//  PublicSentimentMonitorSystem
//
//  Created by 魏强 on 15/12/9.
//  Copyright © 2015年 魏强. All rights reserved.
//

#import "KDVpnModel.h"

@implementation KDVpnModel
+ (NSDictionary *)replacedKeyFromPropertyName{
   return @{@"ID":@"id"
      };
}
- (void)setServerPort:(NSInteger)serverPort{
    _serverPort = serverPort;
    self.port = serverPort;
}
- (void)setEncryptMode:(NSString *)encryptMode{
    _encryptMode = encryptMode;
    self.encryption = encryptMode;
}

- (void)setServerId:(NSString *)serverId{
    _serverId = serverId;
    self.server = serverId;
}

- (void)setServerPwd:(NSString *)serverPwd{
    _serverPwd = serverPwd ;
    self.pwd = serverPwd;
}


- (void)encodeWithCoder:(NSCoder *)encoder
{
    [encoder encodeObject:@(self.ID) forKey:@"ID"];
    [encoder encodeObject:@(self.num) forKey:@"num"];
    [encoder encodeObject:self.encryption forKey:@"encryption"];
    [encoder encodeObject:@(self.port) forKey:@"port"];
    [encoder encodeObject:self.pwd forKey:@"pwd"];
    [encoder encodeObject:self.server forKey:@"server"];
}
- (instancetype)initWithCoder:(NSCoder *)decoder
{
    if (self = [super init]) {
        self.pwd = [decoder decodeObjectForKey:@"pwd"];
        self.port = [[decoder decodeObjectForKey:@"port"] integerValue];
        self.encryption = [decoder decodeObjectForKey:@"encryption"];
        self.server = [decoder decodeObjectForKey:@"server"];
        self.ID = [[decoder decodeObjectForKey:@"ID"] integerValue];
        self.num = [[decoder decodeObjectForKey:@"num"] integerValue];
    }
    return self;
}
@end
